package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.Entity.Dish;
import com.sky.annotation.AutoFill;
import com.sky.emumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {

    @AutoFill(OperationType.INSERT)
    Integer insert(Dish dish);

    Page<Dish> queryPage(Dish dish);

    void delete(List<Long> ids);

    @Select("select * from dish where id=#{id}")
    Dish queryById(Long id);

    @AutoFill(OperationType.UPDATE)
    Integer update(Dish dish);

//    @Select("select * from dish where category_id=#{categoryId}")
    List<Dish> queryByCateGoryId(Long categoryId);
}
